Recently mechanical drive systems are changed to electrical motor-drive systems in vehicles to meet requests for reducing space, improving assembling work and improving control ability. As one exemplary apparatus, a motor is used to drive a shift range switchover mechanism of an automatic transmission of a vehicle. This apparatus has an encoder, which outputs a pulse signal in synchronism with a predetermined angular rotation of a motor, and switches over a shift range to a target shift range by rotationally driving the motor to a target rotation position (target count value) based on a count value of the pulse signal of the encoder (encoder count value) at a shift range switchover time.
In a system, in which the encoder count value is not stored at the time of turning off the electric power supply, the encoder count value does not correspond to an actual rotation position (power supply phase) of the motor at time immediately after the electric power supply is turned on next time. The encoder count value and the power supply phase need be matched by matching the encoder count value and the actual rotation position of the motor after the power supply is turned on so that the power supply phase of the motor is switched over in correspondence to the encoder count value.
Patent document JP-A-2009-112151A (US 2009/0108791 A1) proposes initial learning processing, which is executed as follows. When power supply is turned on in a vehicle, a motor is driven initially by switching over a power supply phase of the motor one cycle sequentially in a predetermined time schedule in open-loop control so that a power supply phase and a rotation position of the motor are matched in either one of power supply phases and a pulse signal of an encoder is counted. When the initial driving operation of the motor is finished, a correction value of a deviation of the power supply phase (learning value of initial position deviation) relative to an encoder count value is learned based on a relation between the encoder count value and the power supply phase. During normal drive control, which follows the initial learning control, the motor is rotationally driven by switching over the power supply phase of the motor sequentially in correspondence to a corrected encoder count value, which is determined by correcting the encoder count value by the power supply phase deviation correction value.
The patent document further proposes re-execution of the initial learning processing, when the learning result is determined to be a failure as a result of checking whether the learned result is correct (success or failure of learning) based on patterns of an A-phase signal and a B-phase signal of the encoder at the time of finishing the initial driving operation processing. In the re-execution of the initial learning processing, the direction of rotation of the motor is reversed from the preceding direction of rotation in the initial driving operation.
In the initial driving operation, the rotational driving of the motor is occasionally restricted depending on a shape of a detent mechanism, which holds the range switchover mechanism in position at respective ranges. The restraint caused by the shape of the detent mechanism is not considered in the patent document. It is therefore likely that the motor is rotationally driven at the time of the initial driving operation against the restraint caused by the shape of the detent mechanism. As a result, the detent mechanism and the range switchover mechanism are likely to be heavily loaded in the initial driving operation. This load will shorten durability of the detent mechanism and the range switchover mechanism or cause range skipping, by which the shift range is switched over unintentionally at the time of the initial driving operation.